import request from '@/utils/request'

// 查询项目合同列表
export function listBfContract(query) {
  return request({
    url: '/contract/bfContract/list',
    method: 'get',
    params: query
  })
}

// 验证当前投资金额是否超过了监控指数
/*
export function validInvestMonitor(query) {
  return request({
    url: '/contract/bfContract/validInvestMonitor',
    method: 'get',
    params: query
  })
}
*/

// 查询项目合同详细
export function getBfContract(id) {
  return request({
    url: '/contract/bfContract/' + id,
    method: 'get'
  })
}

// 保存项目合同
export function saveBfContract(data) {
  return request({
    url: '/contract/bfContract/save',
    method: 'post',
    data: data
  })
}

// 删除项目合同
export function delBfContract(id) {
  return request({
    url: '/contract/bfContract/' + id,
    method: 'delete'
  })
}

// 导出项目合同
export function exportBfContract(query) {
  return request({
    url: '/contract/bfContract/export',
    method: 'get',
    params: query
  })
}

// 删除关键条款
export function delBfContractTerms(id) {
  return request({
    url: '/contract/bfContract/terms/' + id,
    method: 'delete'
  })
}

// 删除投资主体
export function delBfContractInvest(id) {
  return request({
    url: '/contract/bfContract/invest/' + id,
    method: 'delete'
  })
}

// 获取默认的签约主体
export function findInvestMain(dealId) {
  return request({
    url: '/contract/bfContract/findInvestMain/' + dealId,
    method: 'get'
  })
}

// 当前项目的所有已审核完成的合同(下拉)
export function selectContractByDealIdW(dealId) {
  return request({
    url: '/contract/bfContract/selectContractByDealIdW/' + dealId,
    method: 'get'
  })
}

// 根据合同ID获取该合同的付款计划
export function getDealContractPlanByMainIdBf(id) {
  return request({
    url: '/contract/bfContract/getBfContractPlanByMainId/' + id,
    method: 'get'
  })
}

// 根据合同ID获取流程ID
export function findActIdByContractIdBf(contractId) {
  return request({
    url: '/contract/bfContract/findActIdByContractId/' + contractId,
    method: 'get'
  })
}

// 查询当前项目流程审批完成的项目合同
export function findByActStatusAndDealId(dealId) {
  return request({
    url: '/contract/bfContract/findByActStatusAndDealId/' + dealId,
    method: 'get'
  })
}

// 分析报表-管理驾驶舱-新签合同
export function findNewContract(query) {
  return request({
    url: '/contract/bfContract/findNewContract',
    method: 'get',
    params: query
  })
}

// 根据项目ID获取当前项目全部投资主体
export function findMainBodyByDealIdBf(contractId) {
  return request({
    url: '/contract/bfContract/findMainBodyByDealId/' + contractId,
    method: 'get'
  })
}

// 变更合同
export function changeBfContract(data) {
  return request({
    url: '/contract/bfContract/change',
    method: 'post',
    data: data
  })
}

// 终止变更合同
export function terminationChange(id) {
  return request({
    url: '/contract/bfContract/terminationChange/' + id,
    method: 'get'
  })
}

// 合同对比获取差异
export function contractComparisonDifferences(data) {
  return request({
    url: '/contract/bfContract/contractComparisonDifferences',
    method: 'post',
    data: data
  })
}

export function fallback(id) {
  return request({
    url: '/contract/bfContract/fallback/' + id,
    method: 'get'
  })
}
